﻿<phone:PhoneApplicationPage
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:ctrls="clr-namespace:Odyssey.Controls;assembly=Odyssey" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:vm="clr-namespace:OdcTest.ViewModels"
    
    xmlns:Custom="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:Odyssey_Behaviors="clr-namespace:Odyssey.Behaviors;assembly=Odyssey" 
    x:Class="OdcTest.Views.PickerDemo"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="728" d:DesignWidth="480"
    shell:SystemTray.IsVisible="False">
    
    <phone:PhoneApplicationPage.Resources>
        <DataTemplate x:Name="itemTemplate">
            <TextBlock Text="{Binding}" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="48" FontWeight="Bold"/>
        </DataTemplate>
    </phone:PhoneApplicationPage.Resources>

	<phone:PhoneApplicationPage.FontFamily>
		<StaticResource ResourceKey="PhoneFontFamilyNormal"/>
	</phone:PhoneApplicationPage.FontFamily>
	<phone:PhoneApplicationPage.FontSize>
		<StaticResource ResourceKey="PhoneFontSizeNormal"/>
	</phone:PhoneApplicationPage.FontSize>
	<phone:PhoneApplicationPage.Foreground>
		<StaticResource ResourceKey="PhoneForegroundBrush"/>
	</phone:PhoneApplicationPage.Foreground>
    
    <phone:PhoneApplicationPage.DataContext>
        <vm:PickerViewModel/>
    </phone:PhoneApplicationPage.DataContext>

    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="False">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/>
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

	<Custom:Interaction.Behaviors>
		<Odyssey_Behaviors:SwivelEffectBehavior WaitUntilCompleted="True"/>
	</Custom:Interaction.Behaviors>

	<Grid x:Name="LayoutRoot" Background="{StaticResource PhoneChromeBrush}" CacheMode="BitmapCache">
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="*"/>
		</Grid.RowDefinitions>

		<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
			<TextBlock x:Name="ApplicationTitle" Text="PICKER DEMO" Style="{StaticResource PhoneTextNormalStyle}"/>
		</StackPanel>

		<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
			<Grid.ColumnDefinitions>
				<ColumnDefinition/>
				<ColumnDefinition/>
				<ColumnDefinition/>
			</Grid.ColumnDefinitions>
			<ctrls:ItemPicker x:Name="picker1" Grid.Column="0"  Width="146" HorizontalAlignment="Center"  
				ItemTemplate="{StaticResource itemTemplate}"
				ItemsSource="{Binding Days}" SelectedItem="{Binding SelectedDay, Mode=TwoWay}"/>

			<ctrls:ItemPicker x:Name="picker2" Grid.Column="1"  Width="146" HorizontalAlignment="Center" 
				ItemTemplate="{StaticResource itemTemplate}"
				ItemsSource="{Binding Months}" SelectedItem="{Binding SelectedMonth, Mode=TwoWay}"/>

			<ctrls:ItemPicker x:Name="picker3" Grid.Column="2"  Width="146" HorizontalAlignment="Center" 
				ItemTemplate="{StaticResource itemTemplate}"
				ItemsSource="{Binding Years}" SelectedItem="{Binding SelectedYear, Mode=TwoWay}"/>
		</Grid>
	</Grid>

</phone:PhoneApplicationPage>
